<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>温湿度列表</title>
    <script src="/js/echarts.min.js" type="text/javascript"></script>
    <script src="/layui/jquery-1.10.2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="humtemp" style="width: 85%;height:85%;"></div>
<!--<div id="temp" style="width: 1200px;height:400px;"></div>-->
</body>

<script type="text/javascript">
    var humtemp = echarts.init(document.getElementById('humtemp'));
    // var temp = echarts.init(document.getElementById('temp'));

    $.get('/humitures/humitures').done(function (data) {
        humtemp.setOption({
                title: {
                    text: '温湿度折线图'
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['温度(摄氏度)','湿度(百分比)']
                },
                xAxis: {
                    data: data.result.times
                },
                yAxis: {},
                series: [
                    {
                        name: '温度(摄氏度)',
                        type: 'line',
                        stack: 'Total',
                        areaStyle: {},
                        data: data.result.temper
                    },
                    {
                        name: '湿度(百分比)',
                        type: 'line',
                        stack: 'Total',
                        areaStyle: {},
                        data: data.result.hum
                    }]
            });
            // temp.setOption({
            //     title: {
            //         text: '温度折线图'
            //     },
            //     tooltip: {},
            //     legend: {
            //         data: ['温度']
            //     },
            //     xAxis: {
            //         data: data.result.times
            //     },
            //     yAxis: {},
            //     series: [{
            //         name: '温度',
            //         type: 'line',
            //         data: data.result.temperatureList
            //     }]
            // });
        }
    );
</script>
</html>